package com.vicene.gmail.product.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.vicene.gmail.common.valid.AddGroup;
import com.vicene.gmail.common.valid.BrandShowStatusListValues;
import com.vicene.gmail.common.valid.EditGroup;
import com.vicene.gmail.common.valid.UpdateStatusGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 品牌
 * 
 * @author vicene
 * @email 505543479@qq.com
 * @date 2020-10-16 11:50:04
 */

@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@NotNull(message = "修改必须指定品牌id" , groups = {EditGroup.class})
    @Null(message = "新增不能指定品牌id" , groups = {AddGroup.class})
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为null",groups = {EditGroup.class , AddGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotEmpty(message = "logo不能为null",groups = { AddGroup.class})
	@URL(message = "logo必须是一个合法的url地址",groups = {EditGroup.class , AddGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
    @NotNull(groups = {AddGroup.class , UpdateStatusGroup.class})
	@BrandShowStatusListValues(vals = {0 ,1},groups = { AddGroup.class , UpdateStatusGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
    @NotEmpty(message = "检索首字母不能为null",groups = { AddGroup.class })
    @Pattern(regexp = "^[a-zA-Z]$" , message = "检索首字母必须是一个字母",groups = { AddGroup.class , EditGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */
    @NotNull(message = "排序不能为null",groups = { AddGroup.class })
    @Min(value = 0 , message = "排序必须大于等于0",groups = { AddGroup.class , EditGroup.class})
	private Integer sort;

}
